Release 10.1A: OpenEdge Development:
ADM and SmartObjects


Dynamic properties

Dynamic properties are object properties that are defined on an as-needed basis. Two functions, setUserProperty and getUserProperty, support dynamic properties in SmartObjects. They allow you to define dynamic properties without using either the set and get functions or a temp-table FIELD.

The setUserProperty function sets a named property. It is defined in an application as follows:

setUserProperty RETURNS LOGICAL
  ( pcPropName AS CHARACTER, pcPropValue AS CHARACTER ) : 

The getUserProperty function returns the value of a specified property that was previously set using the setUserProperty function. The getUserProperty function is defined as follows:

getUserProperty RETURNS CHARACTER
  ( pcPropName AS CHARACTER ) : 

Because the property values managed by getUserProperty and setUserProperty are stored as part of the ADM-DATA procedure attribute for the SmartObject, they always are stored and returned as CHARACTER strings.

This example illustrates how to set up a dynamic property called NewLimit . It assumes that you have a SmartDataViewer, and a SmartWindow that contains a button that sets a NewLimit attribute in the SmartDataViewer.

To set up the NewLimit dynamic property:

  1. Add the following to the SmartWindow button trigger code, to set the property:
  2. DYNAMIC-FUNCTION(’setUserProperty’:U IN h_v-customer,
      INPUT "NewLimit",
      INPUT dNewLimit:SCREEN-VALUE). 
    

  3. Add the following code to the SmartDataViewer, to get the property:
  4. DECIMAL(DYNAMIC-FUNCTION(’getUserProperty’:U,
      INPUT "NewLimit")). 
    


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095